<?php
session_start();
require_once 'header.php';
function __autoload($className)
	{
    	require_once('class/' . $className . '.class.php');
	}
session::need_member();
session::need_isset($_GET, "orderhistory.php");
if(session::is_manager()==TRUE)
{
	$ArrGet=$_GET;
	$UserId=intval($ArrGet['userid']);
	$OrderId=intval($ArrGet['orderid']);
	$condition=array(
	'user_id' => $UserId,
	'order_id' => $OrderId);
}
else if(session::is_member()==TRUE)
{
	$ArrGet=$_GET;
	$OrderId=intval($ArrGet['orderid']);
	$UserId=session::getuserid();
	$condition=array(
	'user_id' => $UserId,
	'order_id' => $OrderId);
}
else if(session::is_seller()==TRUE)
{
	$ArrGet=$_GET;
	$UserId=intval($ArrGet['userid']);
	$OrderId=intval($ArrGet['orderid']);
	$condition=array(
	'order_id' => $OrderId,
	'user_id' => $UserId,
	'agent' => 'mrhieu'
	);
}

$getPaypal=database::LimitQuery("paypal",array(
'condition' => $condition
));
if(!empty($getPaypal))
{
	$i=0;
	foreach($getPaypal as $paypal)
	{
		$paypalInfo[$i]['paypal_email']=$paypal['paypal_email'];
		$paypalInfo[$i]['paypal_password']=$paypal['paypal_password'];
		$paypalInfo[$i]['balance']=$paypal['balance'];
		$paypalInfo[$i]['is_verify']=$paypal['is_verify'];
		if($paypal['is_verify']=='Y')
		{
			$paypalInfo[$i]['is_verify']="YES";
		}
		else
		{
			$paypalInfo[$i]['is_verify']="No";
		}
		if($paypal['have_pass_mail']=='Y')
		{
			$paypalInfo[$i]['pass_mail']=$paypal['paypal_password'];
		}
		else
		{
			$paypalInfo[$i]['pass_mail']="Dont Have";
		}
		$paypalInfo[$i]['type']=$paypal['status'];
		$paypalInfo[$i]['country']=$paypal['country'];
		$paypalInfo[$i]['bank_info']=$paypal['bank_info'];
		$paypalInfo[$i]['others']=$paypal['card_info']." | ".$paypal['address'];
		$i++;	
	}
}
require_once 'html/paypalOrderDetail.php';
?>